#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    void (Widget:: *mysig_ptr)(QString) = &Widget::mySignal;
    void (Widget:: *myslot_ptr)(QString) = &Widget::mySlot;
    connect(this,mysig_ptr,this,myslot_ptr);
    sendSignal();
}

Widget::~Widget()
{
    delete ui;
}
void Widget::sendSignal()
{
    emit mySignal("hello");
}
void Widget::mySlot()
{
    qDebug()<<"--mySlot()--";
}
void Widget::mySlot(QString str)
{
    str = "hello";
    qDebug()<<str<<"| --mySlot()--";
}
